<?php
/**
 * @since v1.0
 * @modify 2015.6.21
 * @copyright 深圳亿游
 */
require_once(LIB_PATH.'controller/root.con.php');

class goldCon extends rootCon
{
    public function listAction() {
        $uid = mylogin::getUid(true);

        $con = "";
        if(r('type')=='plus'){
            $con = " AND gold>0 ";
        }else if(r('type')=='minus'){
            $con = " AND gold<0 ";
        }

        $log = new GoldLog();
        $sql = "SELECT * FROM ".$log->table()." WHERE uid=".$uid.$con;
        $result = $log->pager($sql);
        $i = 0;
        foreach($result['list']  as $item){
            $result['list'][$i]['gold'] = intval($item['gold']);
            $i++;
        }
        $this->j(0, "list",$result);
    }

}



